﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace JapaneseMusicHtmlCreator
{
    /// <summary>
    /// WindowAddKana.xaml 的交互逻辑
    /// </summary>
    public partial class WindowAddKana : Window
    {
        public string ori, tra;
        public WindowAddKana()
        {
            InitializeComponent();
            ori = null;
            tra = null;
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            Click();

        }

        private void Click()
        {
            if (!string.IsNullOrEmpty(tbTra.Text))
                tra = tbTra.Text;
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            tbOri.Text = ori;
            tbTra.Focus();
        }

        private void tbTra_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
                Click();
        }

        private void Label_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                this.DragMove();
            }
        }

     

     
    }
}
